#!/usr/bin/node 

const http = require('http');

http.createServer((req, res) => {
  console.log(req.method);
  switch(req.method) {
    case 'GET':
      res.end('get method');
    break;

    case 'POST':
      res.end('post method');
    break;

    case 'PUT':
      res.end('put method');
    break;

    case 'DELETE':
      res.end('delete method');
    break;

    default:
      res.end(`${req.method}`);
  }
  //res.end('hello cmt');
  
}).listen(8080);
